package com.example.gulimall.search.vo;

import com.alibaba.fastjson.JSONObject;
import com.example.common.to.es.SkuEsModel;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.util.List;

/**
 * <p>
 *
 * </p>
 *
 * @author zyred
 * @since v 0.1
 **/
@Setter
@Getter
@Accessors(chain = true)
public class SearchResult {

    private List<SkuEsModel> products;
    /*
        当前页码
     */
    private Integer pageNum;
    /*
        总记录数
     */
    private Long total;
    /*
        总页码
     */
    private Integer totalPage;
    /*
        页码详情
     */
    private List<Integer> pageNavs;
    /*
        所有设计到的品牌信息
     */
    private List<BrandVo> brands;
    /*
        所有设计到的属性
     */
    private List<AttrVo> attrs;
    /*
        所有设计到的分类
     */
    private List<CatalogVo> catalogs;
    /*
        面包屑导航
     */
    private List<NavVo> navs;

    @Setter
    @Getter
    @Accessors(chain = true)
    public static class BrandVo {
        private Long brandId;
        private String brandName;
        private String brandImg;

        @Override
        public String toString() {
            return JSONObject.toJSONString(this);
        }
    }

    @Setter
    @Getter
    @Accessors(chain = true)
    public static class AttrVo {
        private Long attrId;
        private String attrName;
        private List<String> attrValue;

        @Override
        public String toString() {
            return JSONObject.toJSONString(this);
        }
    }

    @Setter
    @Getter
    @Accessors(chain = true)
    public static class CatalogVo {
        private Long catalogId;
        private String catalogName;

        @Override
        public String toString() {
            return JSONObject.toJSONString(this);
        }
    }


    @Setter
    @Getter
    @Accessors(chain = true)
    public static class NavVo {
        private String navValue;
        private String navName;
        private String link;

        @Override
        public String toString() {
            return JSONObject.toJSONString(this);
        }
    }



    @Override
    public String toString() {
        return JSONObject.toJSONString(this);
    }
}
